This is an example of using RadarSimPy to get the radar cross section (RCS) of a 3-D object model. Ray-Tracing/Shoot-and-Bounce-Rays method is used in RadarSimPy. The ray-tracing engine RadarSimC, which is built with C++, is integrated in RadarSimPy.
RadarSimPyis a radar simulation package built with python. Contact me if you are interested in this module.
This notebook is available on my GitHub.
The corner reflector model is with .stl. It can be imported by using numpy-stl module.
import numpy as np
from stl import mesh
import plotly.graph_objs as go
from plotly.offline import iplot
mesh_data = mesh.Mesh.from_file('../models/cr.stl')
x = np.ravel(mesh_data.vectors[:, :, 0])
y = np.ravel(mesh_data.vectors[:, :, 1])
z = np.ravel(mesh_data.vectors[:, :, 2])
cr = go.Mesh3d(x=x, y=y, z=z, opacity=1,
i=np.arange(0, np.shape(mesh_data.vectors)[0]*3, 3),
j=np.arange(1, np.shape(mesh_data.vectors)[0]*3, 3),
k=np.arange(2, np.shape(mesh_data.vectors)[0]*3, 3),
)
fig = go.Figure(data=[cr])
iplot(fig)
The RCS calculation function is rcs_sbr
from radarsimpy import rcs_sbr
Define the basic parameters required in ray tracing.
phi (Degree)theta (Degree)freq (Hz)poldensity (number of rays per wavelength)import time
phi = 90
theta = 90
freq = np.arange(1, 78, 1)*1e9
pol = [0, 0, 1]
density = 10
rcs = np.zeros_like(freq)
tic = time.time()
for f_idx, f in enumerate(freq):
rcs[f_idx] = 10*np.log10(rcs_sbr('../models/cr.stl', phi,
theta, f, pol=pol, density=density))
toc = time.time()
Execution time with Arch Linux (kernel 5.4.15, Intel Core i3-6100U, 8 GB RAM)
print('Execution time:', toc-tic, 's')
data = go.Scatter(x=freq/1e9, y=rcs)
layout = go.Layout(
title='RCS vs Frequency',
yaxis=dict(title='RCS (dBsm)'),
xaxis=dict(title='Frequency (GHz)'),
)
fig = go.Figure(data=data, layout=layout)
iplot(fig)
phi = np.arange(0, 180, 0.5)
theta = 90
freq = 60e9
pol = [0, 0, 1]
density = 10
rcs = np.zeros_like(phi)
tic = time.time()
for phi_idx, phi_ang in enumerate(phi):
rcs[phi_idx] = 10 * \
np.log10(rcs_sbr('../models/cr.stl', phi_ang, theta, freq, pol=pol, density=density))
toc = time.time()
Execution time with Arch Linux (kernel 5.4.15, Intel Core i3-6100U, 8 GB RAM)
print('Execution time:', toc-tic, 's')
data = go.Scatter(x=phi, y=rcs)
layout = go.Layout(
title='RCS vs Observation Angle',
yaxis=dict(title='RCS (dBsm)'),
xaxis=dict(title='Observation angle phi (Degree)'),
)
fig = go.Figure(data=data, layout=layout)
iplot(fig)
mesh_data = mesh.Mesh.from_file('../models/audi_r8.stl')
x = np.ravel(mesh_data.vectors[:, :, 0])
y = np.ravel(mesh_data.vectors[:, :, 1])
z = np.ravel(mesh_data.vectors[:, :, 2])
audi = go.Mesh3d(x=x, y=y, z=z, opacity=1,
i=np.arange(0, np.shape(mesh_data.vectors)[0]*3, 3),
j=np.arange(1, np.shape(mesh_data.vectors)[0]*3, 3),
k=np.arange(2, np.shape(mesh_data.vectors)[0]*3, 3),
)
fig = go.Figure(data=[audi])
iplot(fig)
phi = np.arange(0, 360, 1)
theta = 90
freq = 1.5e9
pol = [0, 0, 1]
density = 10
rcs = np.zeros_like(phi)
tic = time.time()
for phi_idx, phi_ang in enumerate(phi):
rcs[phi_idx] = 10 * \
np.log10(rcs_sbr('../models/audi_r8.stl', phi_ang, theta, freq, pol=pol, density=density))
toc = time.time()
Execution time with Arch Linux (kernel 5.4.15, Intel Core i3-6100U, 8 GB RAM)
print('Execution time:', toc-tic, 's')
data = go.Scatter(x=phi, y=rcs)
layout = go.Layout(
title='RCS vs Observation Angle',
yaxis=dict(title='RCS (dBsm)'),
xaxis=dict(title='Observation angle phi (Degree)'),
)
fig = go.Figure(data=data, layout=layout)
iplot(fig)